﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Warranty.Core.IService;
using FX.Core;
using Warranty.Core.Domain;

namespace Warranty.Frm
{
    public partial class PhieuBH : Form
    {
        private readonly IWarrantyNoteService _WarrantyNoteSrv;
        public PhieuBH()
        {
            InitializeComponent();
            _WarrantyNoteSrv = IoC.Resolve<IWarrantyNoteService>();
        }

        private void button11_Click(object sender, EventArgs e)
        {
            WarrantyNote a = new WarrantyNote();
            a.Contents = txtContent.Text;
            a.ClientName = txtClient.Text;
            a.Address = txtAddress.Text;
            a.TimeAppointment = dtpAppointment.Value;
            a.TimeDelivery = DateTime.Now;
            a.TimeReceived = DateTime.Now;
            a.Status = 0;
            _WarrantyNoteSrv.AddOrUpdate(a);
            MessageBox.Show("Nhập thành công");
            DialogResult = DialogResult.OK;
        }

   
    }
}
